{{extend './layout/layout.html'}} {{block 'body'}}
<div class="home-page">
  <div class="banner">
    <div class="container">
      <h1 class="logo-font">conduit</h1>
      <p>A place to share your knowledge.</p>
    </div>
  </div>

  <div class="container page">
    <div class="row">
      <div class="col-md-9">
        <div class="feed-toggle">
          <ul class="nav nav-pills outline-active">
            <li class="nav-item">
              <a class="nav-link disabled" href="">Your Feed</a>
            </li>
            <li class="nav-item">
              <a class="nav-link active" href="">Global Feed</a>
            </li>
          </ul>
        </div>

        {{ each articles }}
        <div class="article-preview">
          <div class="article-meta">
            <a href="profile.html">
              <img src="http://i.imgur.com/Qr71crq.jpg" />
            </a>
            <div class="info">
              <a href="" class="author">{{ $value.author }}</a>
              <span class="date">{{ $value.createdAt }}</span>
            </div>
            <button class="btn btn-outline-primary btn-sm pull-xs-right">
              <i class="ion-heart"></i> 29
            </button>
          </div>
          <a href="{{'/article/'+ $value._id }}" class="preview-link">
            <h1>{{ $value.title }}</h1>
            <p>{{ $value.devscription }}</p>
            <span>Read more...</span>
          </a>
        </div>
        {{ /each }}

        <nav>
          <ul class="pagination">
            <% for(let i = 1; i <= totalPage; i++) { %>
            <li class="page-item <%= i === page ? 'active' : '' %>">
              <a class="page-link" href="/?page=<%= i %>"><%= i %></a>
            </li>
            <% } %>
          </ul>
        </nav>
      </div>

      <div class="col-md-3">
        <div class="sidebar">
          <p>Popular Tags</p>

          <div class="tag-list">
            <a href="" class="tag-pill tag-default">programming</a>
            <a href="" class="tag-pill tag-default">javascript</a>
            <a href="" class="tag-pill tag-default">emberjs</a>
            <a href="" class="tag-pill tag-default">angularjs</a>
            <a href="" class="tag-pill tag-default">react</a>
            <a href="" class="tag-pill tag-default">mean</a>
            <a href="" class="tag-pill tag-default">node</a>
            <a href="" class="tag-pill tag-default">rails</a>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
{{/block}}
